import React from 'react'
import { CapsuleTabs } from 'antd-mobile'
import { Button, Input, Form } from 'react-vant'
import request from '../../api/requset'
import { useNavigate } from 'react-router-dom'
function Index() {
  const [form] = Form.useForm()
  const nav=useNavigate()
  const onFinish = (values) => {
  console.log(values);
  localStorage.setItem('token','deddddscduiehjcuihvudh')
    nav('/home')
  
  }
  return (
    <div>
      <h3 style={{margin:'50px'}}>登录页</h3>
      <CapsuleTabs>
        <CapsuleTabs.Tab title='密码登录' key='fruits'>
          <Form
            form={form}
            onFinish={onFinish}
            footer={
              <div style={{ margin: '16px 16px 0' }}>
                <Button round nativeType='submit' type='primary' block>
                  提交
                </Button>
              </div>
            }
          >
            <Form.Item
              tooltip={{
                message:
                  '密码登录',
              }}
              rules={[{ required: true, message: '请填写用户名' }]}
              name='username'
              label='用户名'
            >
              <Input placeholder='请输入用户名' />
            </Form.Item>
            <Form.Item
              rules={[{ required: true, message: '请填写密码' }]}
              name='password'
              label='密码'
            >
              <Input placeholder='请输入密码' />
            </Form.Item>
          </Form>
        </CapsuleTabs.Tab>
        <CapsuleTabs.Tab title='扫码登录' key='vegetables'>
          <img style={{marginLeft:'110px'}} src="/src/image/111.png" alt="" />
        </CapsuleTabs.Tab>
      </CapsuleTabs>
    </div>
  )
}

export default Index
